﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ECare.BUS;
using ECare.BUS.Data;
using ECare.Client.templates;

namespace ECare.Client.frms
{
    public partial class frmOutInfoCheck : frmInfo
    {
        public frmOutInfoCheck()
        {
            InitializeComponent();

            this.Load += frmOutInfoCheck_Load;
        }

        void frmOutInfoCheck_Load(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            this.ucOutInfo1.CurrentOutInfo = this.entity as PlanOutInfo;
            this.ucOutInfo1.LoadInformation();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            var planinfo = this.entity as PlanOutInfo;

            if (this.rbAcceptable.Checked)
                planinfo.plan_out_check_status = CheckStatus.Qualitified;
            else if (this.rbRejected.Checked)
                planinfo.plan_out_check_status = CheckStatus.Rejected;
            else
            {
                planinfo.plan_out_check_status = CheckStatus.Pending;
            }

            planinfo.plan_out_check_remark = this.txtRemark.Text;
            PlanHelper.CheckPlanOuts(planinfo);
            this.Close();
        }
    }
}
